<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let a = 5000 
        alert(`本账号余额${a}元`)
        let b = prompt('存钱 取钱 余额 退出--按4退出')
        while(true){

            if (b=== '4'){
                break
            }
            switch(b){
                case '存钱': 
                    let c = +prompt('输入存钱金额')
                    a += c 
                    alert(`成功存入${c}元，现在共${a}元`)
                    break; 
                case '取钱':
                    let d = +prompt('输入取钱金额')
                    a -= d 
                    alert(`成功取出${d}元，现在共${a}元`)
                    break;
                case '余额':
                    alert(`账号余额${a}元`)
                    break;
                case '4':
                    break;
            default:
                    alert('无效输入')
                    break;
            }
            
               if (b=== '4'){
                break
            } 
        }
    </script>
</body>
</html>